//
//  MainViewController.m
//  YMJReadColor
//
//  Created by 殷殷明静 on 16/9/10.
//  Copyright © 2016年 MJ.Y. All rights reserved.
//

#import "MainViewController.h"
#import "RootTableViewController.h"
#import "GereralVideoViewController.h"
@interface MainViewController ()

@property (nonatomic, strong)  GereralVideoViewController*videoVC;

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.homeVC = [[HomeViewController alloc] init];
    UINavigationController *homeNavigationVC = [[UINavigationController alloc] initWithRootViewController:_homeVC];
    
    self.videoVC = [[GereralVideoViewController alloc] init];
    UINavigationController *videoNavigationVC = [[UINavigationController alloc] initWithRootViewController:_videoVC];
    self.myselfVC = [[MyViewController alloc] init];
    UINavigationController *myselfNavigationVC = [[UINavigationController alloc] initWithRootViewController:_myselfVC];
    self.viewControllers = @[homeNavigationVC,videoNavigationVC,myselfNavigationVC];
    // 样式
    // 选中为红色
    [self.tabBar setTintColor:[UIColor redColor]];
    
    UIImage *homeImage = [UIImage imageNamed:@"tab_icon_home_nomal"];
    UIImage *videoImage = [UIImage imageNamed:@"tab_video_nomal"];
    UIImage *myselfImage = [UIImage imageNamed:@"tab_myself_noaml"];
    homeImage = [homeImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    videoImage = [videoImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    myselfImage = [myselfImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    homeNavigationVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"首页" image:homeImage selectedImage:[UIImage imageNamed:@"tab_icon_home_nomal"] ];
    videoNavigationVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"视频" image:videoImage selectedImage:[UIImage imageNamed:@"tab_video_nomal"]];
    myselfNavigationVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"我" image:myselfImage selectedImage:[UIImage imageNamed:@"tab_myself_noaml"]];
    // 字体大小
    UIFont *customFont = [UIFont fontWithName:@"FZKaTong-M19S" size:9];
    //正常字体大小颜色
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName:customFont,NSForegroundColorAttributeName:[UIColor blackColor]} forState:0];
    //选中字体大小颜色
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName:customFont,NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateSelected];
    // 背景颜色+ 不透明效果
    [[UITabBar appearance] setBackgroundColor:[UIColor whiteColor]];
    [UITabBar appearance].translucent = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
